/**
 *@param {*}wx_insert 获取微信加密参数接口
 *@param {*}login 获取微信Access token
 *@param {*}wx_message 回调微信的信息
 *@param {*}check_scan 微信轮询接口
 */
 const WxLoginService = require('../service/WxLoginService')


 const WxLoginController = {
    wx_insert: async(req, res) => {
      const { signature, timestamp, nonce, echostr} = req.query;
      let handleRes =await WxLoginService.wx_insert(signature, timestamp, nonce, echostr);
      res.send(handleRes);
    },
    login:async(req,res) =>{
        let handleRes = await WxLoginService.login();
        res.send(handleRes);
    },
    wx_message:async(req,res) =>{
        let handleRes = await WxLoginService.wx_message(req);
        res.send(handleRes);
    },
    check_scan:async(req,res) => {
      const {ticket} = req.query
      let handleRes = await WxLoginService.check_scan(ticket);
        res.send(handleRes);
    }
  };
  module.exports = WxLoginController;
  